<template>
  <div>
    <div class="box_list" v-infinite-scroll="loadMore" infinite-scroll-disabled="busy" infinite-scroll-distance="3">
    <ul>
      <li class="msglist" v-for="item in haplist" :key="item.orderId">
         <div>余额:{{item.companyBalance |amountMin100(2)}}</div>
         <div>
           <p v-if="item.orderType==-2||item.orderType==-1||item.orderType==-3||item.orderType==-4" style="font-size:16px; text-align:right;">-{{item.amount|amountMin100(2)}}</p>
             <p v-else style="font-size:16px; text-align:right;">+{{item.amount|amountMin100(2)}}</p>
           <p style="font-size:13px;">{{item.ctime |formatDateTIME()}}</p>
         </div>
      </li>
    </ul>
    </div>
   <loadingtmp :busy="busy" :datalength="haplist.length" :loadall="loadall" style=" margin-bottom:50px;"></loadingtmp>
  </div>
</template>

<script>
import navfooter from "@/views/merchant/footer/me_footer";
 import loadingtmp from '@/components/load/loading'
export default {
   components: {
     loadingtmp
   },
  data() {
    return {
      haplist:'',
      busy:false,
      loadall:false,
      page:1
    };
  },
  mounted() {
    // this.hones()
  },
  methods: {
     loadMore(){
        console.log('到底')
           setTimeout(() => {
          this.hones(this.page > 1);
      }, 1000);
     },
    hones(){
         this.$http
        .get(this.APIURL_PREFIX + "/api/wap/company/profit",{params:{page:this.page,rows:20}})
        .then(res => {
              console.log(res)
                  if(res.data.data==''||res.data.data.length<1){
            this.busy=false
            this.loadall=true
            console.log('false')
          }
            if(res.data.data.length<10){
            this.busy=false
            this.loadall=true
          }
                 if(this.page==1){
            this.haplist=res.data.data
            console.log('替换')
          }else{
            this.haplist=this.haplist.concat(res.data.data)
          }
                this.page++
                console.log(this.page)
        })
    },
}
}
</script>

<style scoped>
@import "../../assets/personal/css/me_monxq.css";
</style>
